import 'package:FiduMart/generated/json/base/json_convert_content.dart';
import 'package:FiduMart/core/network/model/club_manexianshi_entity.dart';

ClubManexianshiEntity $ClubManexianshiEntityFromJson(
    Map<String, dynamic> json) {
  final ClubManexianshiEntity clubManexianshiEntity = ClubManexianshiEntity();
  final String? id = jsonConvert.convert<String>(json['id']);
  if (id != null) {
    clubManexianshiEntity.id = id;
  }
  final String? nameZh = jsonConvert.convert<String>(json['nameZh']);
  if (nameZh != null) {
    clubManexianshiEntity.nameZh = nameZh;
  }
  final String? nameEn = jsonConvert.convert<String>(json['nameEn']);
  if (nameEn != null) {
    clubManexianshiEntity.nameEn = nameEn;
  }
  final String? nameTha = jsonConvert.convert<String>(json['nameTha']);
  if (nameTha != null) {
    clubManexianshiEntity.nameTha = nameTha;
  }
  final double? type = jsonConvert.convert<double>(json['type']);
  if (type != null) {
    clubManexianshiEntity.type = type;
  }
  return clubManexianshiEntity;
}

Map<String, dynamic> $ClubManexianshiEntityToJson(
    ClubManexianshiEntity entity) {
  final Map<String, dynamic> data = <String, dynamic>{};
  data['id'] = entity.id;
  data['nameZh'] = entity.nameZh;
  data['nameEn'] = entity.nameEn;
  data['nameTha'] = entity.nameTha;
  data['type'] = entity.type;
  return data;
}

extension ClubManexianshiEntityExt on ClubManexianshiEntity {
  ClubManexianshiEntity copyWith({
    String? id,
    String? nameZh,
    String? nameEn,
    String? nameTha,
    double? type,
  }) {
    return ClubManexianshiEntity()
      ..id = id ?? this.id
      ..nameZh = nameZh ?? this.nameZh
      ..nameEn = nameEn ?? this.nameEn
      ..nameTha = nameTha ?? this.nameTha
      ..type = type ?? this.type;
  }
}